-----------------------------------------------------------------------------------------------------------------------------------------------
--解析LLMakeLists.txt生成Token输出到globalTableTokenTable
-----------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------
--全局变量存储全局信息
-----------------------------------------------------------------------------------------------------------------------------------------
globalTableTokenTable = {}

local localStrLuaName="Token.lua"
if globalBoolLuaDebugOutputFlag then
	print(localStrLuaName.." start...")
end
-----------------------------------------------------------------------------------------------------------------------------------------
--common tools 
-----------------------------------------------------------------------------------------------------------------------------------------
require(globalStrModuleUtilities)
--if globalBoolLuaDebugOutputFlag then
--	print(package.path)
--end

-----------------------------------------------------------------------------------------------------------------------------------------
--LLMakeLists.txt解析读入
-----------------------------------------------------------------------------------------------------------------------------------------
io.input(globalStrLLMakeListsFile)
--scan LLMakeLists.txt optain sources & targets and compile rules
local LLMakeListsbuff = ""

for line in io.lines() do
--delete comennt lines   ( begin with #) 
	line = skipHeadSpace(line)
	if nil ~= line then
		local headp,headq = string.find(line,"#")
		if 1 ~= headp then
			LLMakeListsbuff = LLMakeListsbuff..line.."  " 
		end
	end
end
--print(LLMakeListsbuff)
-----------------------------------------------------------------------------------------------------------------------------------------
--LLMakeLists.txt Token解析主循环
-----------------------------------------------------------------------------------------------------------------------------------------
local TokenTable = {}
TokenTable = nativeToolString2Token(LLMakeListsbuff)
-----------------------------------------------------------------------------------------------------------------------------------------
--${变量}Token合并
-----------------------------------------------------------------------------------------------------------------------------------------
local partern = {"$","{","*","}"}
TokenTable = jointTokenByFormat(TokenTable,partern)
-----------------------------------------------------------------------------------------------------------------------------------------
--代入全局变量
-----------------------------------------------------------------------------------------------------------------------------------------
globalTableTokenTable = TokenTable
-----------------------------------------------------------------------------------------------------------------------------------------
--打印Token
-----------------------------------------------------------------------------------------------------------------------------------------
if globalBoolLuaDebugOutputFlag then
	for i,v in pairs (globalTableTokenTable) do 
		print(i,v)
	end
end
if globalBoolLuaDebugOutputFlag then
	print(localStrLuaName.." ...end")
end
